#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QWidget>
#include <QPushButton>
#include <QtNetwork>
#include <QTextEdit>
#include "Cards.h"
#include "Player.h"


class MainWindow : public QWidget
{
    Q_OBJECT
    public:
        MainWindow();

    private slots:
        void connexion();
        void start();

        void nextPhaseRequested();

    private:
        void log(const QString txt, bool time = true);

        int findPlayerIndex(ClientSocket* net);

        void nextPlayer();

        bool m_started;

        bool m_first;

        size_t m_nbrPlayer;
        QList<Player*> m_players;

        QList<State> m_states;

        size_t m_currPlay;
        PHASE m_currPhase;

        QTcpServer* m_server;
        QTextEdit* m_text;
        QPushButton* m_start;

        Cards* m_cards;
};

#endif
